// ----------- GLOBAL -------------
@import './vars';
@import './mixins';

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
    'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}

// ----------- reset ----------
body, html, #root {
  height: 100%;
}

html {
  .scrollbar(8px, 20px);
}

hr {
  margin: 0;
  border-color: @color-n1-3;

  &.devider {
    margin-top: 16px;
    margin-bottom: 16px;
  }
}

* {
  box-sizing: border-box;
}

:focus {
  outline-width: 0;
}

.iconfont {
  font-size: inherit;
  -webkit-text-stroke-width: 0;
}

.animated-faster {
  .animated-faster();
}

.text-muted {
  color: @color-n2-5;
}

.text-error {
  color: @color-error;

  &:hover {
    color: @color-error;
  }
}

.text-warn {
  color: @color-warning;

  &:hover {
    color: @color-warning;
  }
}

.text-success {
  color: @color-success;
}

.text-info {
  color: @color-sky;
}

.text-link {
  color: @color-link;
}

.clearfix {
  .clearfix()
}

.fx-bt {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fx-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.fx-air {
  flex: 1 1 0;
}

.pretty-link {
  .pretty-link();
}

a[data-disabled="true"], a.disabled {
  color: @color-n2-5;
  pointer-events: none;
}

// for common/util@copy2Clipboard
.clipboard-hidden {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 9999;
  opacity: 0;
  border: none;
  width: 10px;
  height: 10px;
}

// 纯 CSS 文字提示
[data-tips] {
  position: relative;

  &[data-disabled="true"] {
    pointer-events: all;
    cursor: default;

    &:active {
      pointer-events: none;
    }
  }

  &::before, &::after {
    position: absolute;
    z-index: 100;
    pointer-events: none;
    transition: transform .3s ease, opacity .3s ease;
    font-size: 12px;
    transform: translate(-10px, 0) scale(.9166667);
    transform-origin: left center;
    opacity: 0;
  }

  &::after {
    content: attr(data-tips);
    color: @color-white;
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    padding: 0 8px;
    left: calc(100% + 4px);
    top: calc(50% - 12px);
    background-color: fadeout(@color-black, .3);
    height: 24px;
  }

  &::before {
    content: '';
    border-style: solid;
    border-width: 4px 4px 4px 0;
    border-color: transparent fadeout(@color-black, .3);
    left: calc(100% + 1px);
    top: calc(50% - 4px);
  }

  &:hover::after, &:hover::before {
    opacity: 1;
    transform: translate(0, 0) scale(.9166667);;
  }

  // &:active::after, &:active::before {
  //   opacity: 0;
  //   transform: translate(-10px, 0) scale(.9166667);
  // }
}
